package main

import "fmt"

type Mover interface {
	move()
}

type dog struct{}

func (d *dog) move() {
	fmt.Println("狗会动")
}

type People interface {
	Speak(string) string
}

type Student struct{}

func (stu *Student) Speak(think string) (talk string) {
	if think == "sb" {
		talk = "你是个大帅比"
	} else {
		talk = "您好"
	}
	return
}

func main() {
	var x Mover
	// var wangcai = dog{} // 旺财是dog类型
	// x = wangcai         // x可以接收dog类型
	// x.move()
	var fugui = &dog{} // 富贵是*dog类型
	x = fugui          // x可以接收*dog类型
	x.move()

	var peo People = &Student{}
	think := "sb"
	fmt.Println(peo.Speak(think))
}
